﻿using System;
using System.Collections.Generic;
using Finance.Data.Entities;
using Finance.TodoSoft;

namespace Finance.Tests.DataStubs
{
	internal class StubDocument : IDocument
	{
		public StubDocument()
		{
			Products = new TracedList<IDocumentProduct>();
		}

		public Guid Id { get; set; }

		public int SaveCallsCount = 0;

		public void Save()
		{
			SaveCallsCount++;
		}

		public string Description { get; set; }
		public DateTime DocDate { get; set; }
		public decimal Amount { get; set; }
		public string SubTypeName { get; set; }
		public DocumentType DocumentType { get; set; }
		public IList<IDocumentProduct> Products { get; private set; }
		public string ContractorName { get; private set; }
		public Guid DocumentTypeId { get; set; }
		public IContractor Contractor { get; set; }
		public Guid ContractorId { get; set; }

		public IDocumentProduct NewProduct()
		{
			return new DocumentProduct(null);
		}
	}
}